import { Injectable } from '@angular/core';
import { Observable, Subject } from 'rxjs';

@Injectable({
  providedIn: 'root'
})
export class MessageService {

  private messageSubject = new Subject<any>();

  constructor() { }

  setMessageCount(count: number) {
    this.messageSubject.next(count);
  }

  getMessageCount(): Observable<number> {
    return this.messageSubject.asObservable();
  }
}
